<div class="applytab">
    <span class="applytab_bt_now applytab_bigger" >品牌专区</span>
</div>
<div style="margin-bottom:8px;">
<table cellpadding="0" border="1" cellspacing="0" class="xgrouplist" style="border-collapse:collapse;border:1px dotted #c9cacb">
<tr>
<?php 
for ($i=1;$i<=21;$i++) { ?>
    <td>
    <?php if (!empty($group[$i-1])) { 
        $da = $group[$i-1]['g_sharegroups'];
        ?>
    <a href="javascript:goShare(1,'<?=$da['pids']?>')"><img style="width:106px" src="<?=SystemProperties::$app_host_webroot?>/product_img/<?=$da['pic']?>" /></a>
    <?php } else { ?>
    &nbsp;
    <?php }?>
    </td>
    <?php if ($i%7==0 && $i!=21) { ?>
    </tr><tr>
    <?php } ?>
<?php } ?>
</tr>
</table>

</div>
<div class="applytab">
    <span class="applytab_bt_now applytab_bigger" >宝贝分享</span>
    <span class="applytab_pager applytab_pager_unshare" onclick="doChangePage('myluck')" style="cursor:pointer">您还有<?=$unshare?>个宝贝没有分享</span>
</div>
<script type="text/javascript">
function showS(id) {
    $('s_as_'+id).setStyle('display','none');

    $('s_sh_'+id).setStyle('display','');
    $('s_tr_'+id).setStyle('display','');
}
function hideS(id) {
    $('s_sh_'+id).setStyle('display','none');
    $('s_tr_'+id).setStyle('display','none');
    
    $('s_as_'+id).setStyle('display','');
}
</script>
<table cellpadding="0" cellspacing="0" class="share_list_table">
<?php 
function show_a_link($d) { 
    $js_act = $d['how_get'] == 'zhuan'?'showProduct':'showChangeProduct';
    $p_a = '<a href="javascript:'.$js_act.'('.$d['product_info']['g_id'].')">'.$d['product_info']['g_name'].'</a>';
    echo $p_a;
}
?>
<?php if (!empty($data)) foreach ($data as $da) { ?>
<tr class="bt">
<td width="40" style="padding:0px 10px;"><img src="<?=$da['g_users']['g_head']?>" width="23" height="23" style="padding:1px;border:1px solid #bbb" /></td>
<td width="100" style="line-height:20px;"><?=$da['g_users']['g_name']?><br /><?=date('Y-m-d',strtotime($da['g_lucks']['share_time']))?></td>
<td width="220"><?=show_a_link($da['g_lucks'])?></td>
<td width="380" align="center" onclick="javascript:showS(<?=$da['g_lucks']['seqid']?>)" style="cursor:pointer"><?=htmlspecialchars(mb_substr($da['g_lucks']['share_detail']['content'], 0, 24))?></td>
<td>
<a id="s_as_<?=$da['g_lucks']['seqid']?>" href="javascript:showS(<?=$da['g_lucks']['seqid']?>)"><img src="<?=SystemProperties::$path?>/image/new/zhankai.gif" /></a>
<a id="s_sh_<?=$da['g_lucks']['seqid']?>" style="display:none" href="javascript:hideS(<?=$da['g_lucks']['seqid']?>)"><img src="<?=SystemProperties::$path?>/image/new/shouqi.gif" /></a>
</td>
</tr>
<tr style="display:none;" id="s_tr_<?=$da['g_lucks']['seqid']?>">
<?php if (!empty($da['g_lucks']['share_detail']['photo'])) { ?>
<td colspan="2" style="padding:0px 10px;"><img width="120" src="<?=SystemProperties::$app_host_webroot?>/userpic/<?=$da['g_lucks']['share_detail']['photo']?>" /></td>
<td colspan="3" style="line-height:20px;"><?=htmlspecialchars($da['g_lucks']['share_detail']['content'])?></td>
<?php } else { ?>
<td colspan="5" style="padding:0px 10px;line-height:20px;" ><?=htmlspecialchars($da['g_lucks']['share_detail']['content'])?></td>
<?php } ?>
</tr>
<?php } ?>
</table>


<?php 
$next_p = ($page>=$totalp)?$totalp:$page+1;
$prev_p = ($page<=1)?1:$page-1;
?>
<div style="text-align:center">
<a href="javascript:goShare(<?=$prev_p?>,'<?=$pids_str?>')"><img src='<?=SystemProperties::$path?>/image/new/goprev.gif' border='0' /></a>
<b>&nbsp;<?=$page?>/<?=$totalp?>&nbsp;</b>
<a href="javascript:goShare(<?=$next_p?>,'<?=$pids_str?>')"><img src='<?=SystemProperties::$path?>/image/new/gonext.gif' border='0'/></a>
</div>
